# 3.16 OLED Display ## 3.16.1 Overview OLED display is also called organic light-emitting diode or organic dot laser display. This display is self-luminous. It adopts a very thin coating of organic materials and glass substrate which will light up if current passes through. Therefore, it does not require a back-light. Note that it will not light up when just powering on; programing and wiring are also needed. Besides, it features large viewing Angle, low power consumption, high contrast, thin display, fast response, simple structure, and can work on flexion boards within a wide temperature range. ## 3.16.2 Parameters Communication mode: I2C communication Internal driver chip: SSH1106 Resolution: 128 x 64 ## 3.16.3 Code Blocks Blocks in ![LEDDisplay](./media/LEDDisplay.png): 1. ![t125](./media/t125.png) is used to control the OLED display of the coding box. Different display patterns can be created by yourself through the mouse. 2. ![t126](./media/t126.png) is used to set the OLED display patterns. 3. ![t127](./media/t127.png) clears all display. 4. ![t128](./media/t128.png) shows a rectangle on the OLED. Just set the values of X and Y. 5. ![t129](./media/t129.png) clears the display of ![t128](./media/t128.png). 6. ![t130](./media/t130-1745396309569-18.png) sets characters to show on OLED. 7. ![t131](./media/t131.png) sets scrolling characters to show on OLED. 8. ![t132](./media/t132.png) stops showing scrolling characters on OLED. -------- The code blocks in ![TFT](./media/TFT.png) also control the display of OLED, and there are more ways for it. For details, please visit [OLED Library | MicroBlocks Wiki](https://wiki.microblocks.fun/en/extension_libraries/oled). ------- Blocks in ![](./media/codingBox.png): 1. ![t174](./media/t174.png) is a block included in coding box library. It controls the values in the characters or variables displayed by the OLED in the coding box. The display position and size can be set. 2. ![t175](./media/t175.png) is a block included in coding box library. It clears the content displayed on the OLED. ## 3.16.4 Test Code You can manually build blocks, or directly open the code file we provide: `3-16-OLED.ubp`. If you have any questions about how to open code files or upload code, please back to `1.9 Upload Code`. **Build code blocks:** 1. In ![](./media/control.png), drag ![](./media/t1.png) and ![](./media/t2.png) to the script area, and stack them together. ![t34](./media/t34.png) 2. In ![LEDDisplay](./media/LEDDisplay.png), drag ![t135](./media/t135.png) and place in ![](./media/t2.png). Set the icon to ![t134](./media/t134.png). 3. In ![](./media/control.png), drag ![t4](./media/t4.png) and put it under ![t134](./media/t134.png). 4. `duplicate all` ![t134](./media/t134.png) and put the copy under ![t4](./media/t4.png), and set the icon to ![t133](./media/t133.png). **Complete code:** ![t136](./media/t136.png) ## 3.16.5 Test Result Connect the coding box to the MicroBlocks via USB or Bluetooth, and click ![t59](./media/t59.png) to upload the code to the coding box. The OLED displays ![t134](./media/t134.png) and ![t133](./media/t133.png) alternately with each for 0.5s.